package org.example.controller;

import jakarta.annotation.Resource;
import org.example.service.CateGoryService;
import org.example.util.JsonResult;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther:Liu
 * @Testname:CateGoryController
 * @Date:2025/8/7 8:36
 */
@RestController
@RequestMapping("/CateGory")
public class CateGoryController {
    @Resource
    private CateGoryService cateGoryService;

    @GetMapping("/findAll")
    public JsonResult findAllCateGory() {
        return cateGoryService.findAllCateGory();
    }

    @DeleteMapping("/delete1/{categoryId}")
    public JsonResult removeByCateId1(@PathVariable("categoryId") String categoryId){
        return cateGoryService.removeByCateId1(categoryId);
    }

    @DeleteMapping("/delete2/{categoryId}")
    public JsonResult removeByCateId2(@PathVariable("categoryId") String categoryId){
        return cateGoryService.removeByCateId2(categoryId);
    }
}
